package com.gaohe.scp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.scp.mapper.CsCarQuoteMapper;
import com.gaohe.scp.domain.CsCarQuote;
import com.gaohe.scp.service.ICsCarQuoteService;

/**
 * 车辆报价Service业务层处理
 * 
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Service
public class CsCarQuoteServiceImpl implements ICsCarQuoteService 
{
    @Autowired
    private CsCarQuoteMapper csCarQuoteMapper;


    @Override
    public CsCarQuote selectCsCarQuoteByCarId(Long carId)
    {
        return csCarQuoteMapper.selectCsCarQuoteByCarId(carId);
    }
    /**
     * 查询车辆报价
     * 
     * @param quoteId 车辆报价主键
     * @return 车辆报价
     */
    @Override
    public CsCarQuote selectCsCarQuoteByQuoteId(Long quoteId)
    {
        return csCarQuoteMapper.selectCsCarQuoteByQuoteId(quoteId);
    }

    /**
     * 查询车辆报价列表
     * 
     * @param csCarQuote 车辆报价
     * @return 车辆报价
     */
    @Override
    public List<CsCarQuote> selectCsCarQuoteList(CsCarQuote csCarQuote)
    {
        return csCarQuoteMapper.selectCsCarQuoteList(csCarQuote);
    }

    /**
     * 新增车辆报价
     * 
     * @param csCarQuote 车辆报价
     * @return 结果
     */
    @Override
    public int insertCsCarQuote(CsCarQuote csCarQuote)
    {
        csCarQuote.setCreateTime(DateUtils.getNowDate());
        return csCarQuoteMapper.insertCsCarQuote(csCarQuote);
    }

    /**
     * 修改车辆报价
     * 
     * @param csCarQuote 车辆报价
     * @return 结果
     */
    @Override
    public int updateCsCarQuote(CsCarQuote csCarQuote)
    {
        csCarQuote.setUpdateTime(DateUtils.getNowDate());
        return csCarQuoteMapper.updateCsCarQuote(csCarQuote);
    }

    /**
     * 批量删除车辆报价
     * 
     * @param quoteIds 需要删除的车辆报价主键
     * @return 结果
     */
    @Override
    public int deleteCsCarQuoteByQuoteIds(Long[] quoteIds)
    {
        return csCarQuoteMapper.deleteCsCarQuoteByQuoteIds(quoteIds);
    }

    /**
     * 删除车辆报价信息
     * 
     * @param quoteId 车辆报价主键
     * @return 结果
     */
    @Override
    public int deleteCsCarQuoteByQuoteId(Long quoteId)
    {
        return csCarQuoteMapper.deleteCsCarQuoteByQuoteId(quoteId);
    }
}
